package com.pcbly.web.bean;

import java.util.Iterator;

import com.pcbly.web.bean.news.TreeEntityBean;
 

public final class TreeHelper {
	protected TreeHelper() {
	}

	@SuppressWarnings("unchecked")
	public static boolean checkDeadLock(TreeEntityBean current,
			TreeEntityBean parent) {
		if (current == null || parent == null || current.equals(parent))
			return true;
		for (Iterator i$ = current.getChildren().iterator(); i$.hasNext();) {
			TreeEntityBean child = (TreeEntityBean) i$.next();
			boolean isDeadLock = checkDeadLock(child, parent);
			if (isDeadLock)
				return true;
		}
		return false;
	}

}
